cmake_minimum_required(VERSION 3.0.2)
project(loop_addition_action)

#依赖包
find_package(catkin REQUIRED COMPONENTS roscpp std_msgs actionlib actionlib_msgs)

#Action文件
add_action_files(
  FILES
  AddInts.action
)
#生成Action依赖的头文件
generate_messages(
  DEPENDENCIES
  actionlib_msgs
)

catkin_package(
    CATKIN_DEPENDS
    actionlib_msgs
)

#可执行程序依赖头文件的目录
include_directories(
 include
 ${catkin_INCLUDE_DIRS}
)

#可执行程序、依赖、链接
add_executable(${PROJECT_NAME}_server_node src/action_server.cpp)
add_dependencies(${PROJECT_NAME}_server_node ${PROJECT_NAME}_gencpp)
target_link_libraries(${PROJECT_NAME}_server_node ${catkin_LIBRARIES})

#可执行程序、依赖、链接
add_executable(${PROJECT_NAME}_client_node src/action_client.cpp)
add_dependencies(${PROJECT_NAME}_client_node ${PROJECT_NAME}_gencpp)
target_link_libraries(${PROJECT_NAME}_client_node ${catkin_LIBRARIES})

